package cn.alone.basic.util;

import lombok.Data;

/*
给前端返回通知消息的类
 */
@Data
public class AjaxResult {

    private String message = "操作成功";
    private Boolean success = true;
    private Object resultObj; //封装自定义返回值参数

    //内部提供创建自己的静态方法
    public static AjaxResult me(){return new AjaxResult();}


    /**
     * 链式编程
     *
     * @param message
     * @return
     */
    public AjaxResult setMessage(String message){
        this.message = message;
        return this;
    }
    public  AjaxResult setSuccess(Boolean success){
        this.success = success;
        return this;
    }
    public AjaxResult setResultObj(Object resultObj){
        this.resultObj = resultObj;
        return  this;
    }

}
